package com.block.test.service.record;

import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.block.common.model.dto.ReqRecordDTO;
import com.block.common.enums.ApiReqEnum;
import com.block.common.enums.CountTypeEnum;
import com.block.test.service.IReqRecordService;
import org.springframework.stereotype.Service;

/**
 * 系统统计
 *
 * 产品统计（每个请求都进行统计）
 *
 */
@Service
public class SysCountRecordService implements IReqRecordService {


    @Override
    public ReqRecordDTO handleReqInfo(JSONObject transData) {

        String operType = transData.getString("operType");
        if (!StrUtil.equals(operType, CountTypeEnum.PROD_UV.getValue())){
            return null;
        }

        ReqRecordDTO reqRecordDTO = new ReqRecordDTO();
        reqRecordDTO.setUriType(ApiReqEnum.PROD_UV.getType());

        return reqRecordDTO;
    }
}
